/*
Copyright (c) 2008, Adobe Systems Incorporated
All rights reserved.

Redistribution and use in source and binary forms, with or without 
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, 
    	this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, 
    	this list of conditions and the following disclaimer in the 
    	documentation and/or other materials provided with the distribution.
    * Neither the name of Adobe Systems Incorporated nor the names of its 
    	contributors may be used to endorse or promote products derived from 
    	this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.
*/
/**
 * These are the common errors that can happen during
 * a call to a flickr method.  Each method may have
 * some method-specific errors, and unfortunately
 * they don't share error #'s so we can't put them
 * in this class.
 *
 * For instance, an error code of 1 for "flickr.blogs.postPhoto"
 * is "Blog not found", whereas the same code of 1 for
 * "flickr.photos.addTags" is "Photo not found", which means the
 * developer using this API will have to check the method-specific
 * errors by hand instead of with these constants.
 */
package com.adobe.webapis.flickr;

class FlickrError
{
	public var errorCode(getErrorCode, setErrorCode) : Int;
	public var errorMessage(getErrorMessage, setErrorMessage) : String;

	/** The passed signature was invalid. */
	static public var INVALID_SIGNATURE : Int = 96;
	/** The call required signing but no signature was sent. */
	static public var MISSING_SIGNATURE : Int = 97;
	/** The login details or auth token passed were invalid. */
	static public var LOGIN_FAILED : Int = 98;
	/** The method requires user authentication but the user was not logged in, or the authenticated method call did not have the required permissions. */
	static public var INSUFFICIENT_PERMISSIONS : Int = 99;
	/** The API key passed was not valid or has expired. */
	static public var INVALID_API_KEY : Int = 100;
	/** The requested service is temporarily unavailable. */
	static public var SERVICE_CURRENTLY_UNAVAILABLE : Int = 105;
	/** The requested response format was not found. */
	static public var FORMAT_NOT_FOUND : Int = 111;
	/** The requested method was not found. */
	static public var METHOD_NOT_FOUND : Int = 112;
	/** The SOAP envelope send in the request could not be parsed. */
	static public var INVALID_SOAP_ENVELOPE : Int = 114;
	/** The XML-RPC request document could not be parsed */
	static public var INVALID_XML_RPC_CALL : Int = 115;
	var _errorCode : Int;
	var _errorMessage : String;
	/**
	 * Constructs a new FlickrError instance
	 * @langversion ActionScript 3.0
	 * @playerversion Flash 8.5
	 * @tiptext
	 */
	public function new()
	{
		// do nothing
	}

	/**
	 * The error code returned from Flickr
	 *
	 * @langversion ActionScript 3.0
	 * @playerversion Flash 8.5
	 * @tiptext
	 */
	public function getErrorCode() : Int
	{
		return _errorCode;
	}

	public function setErrorCode(value : Int) : Int
	{
		_errorCode = value;
	}

	/**
	 * The error message returned from Flickr
	 *
	 * @langversion ActionScript 3.0
	 * @playerversion Flash 8.5
	 * @tiptext
	 */
	public function getErrorMessage() : String
	{
		return _errorMessage;
	}

	public function setErrorMessage(value : String) : String
	{
		_errorMessage = value;
	}

}

